package com.youxin.busfoundation.enums;

import java.util.ArrayList;
import java.util.List;

import com.youxin.busfoundation.common.KeyValue;

/**
 * 企业规模
 * @author yingde.cao
 *
 *50人以下
50-150人
150-500
500-1000
1000人以上
 */
public enum EnterpriseScaleType {
	
	All(0,"未知"),
	Less50(1,"50人以下"),
	Less150(2,"50-150人"),
	Less500(3,"150-500人"),
	Less1000(4,"500-1000人"),
	Greater1000(5,"1000人以上")
//	Less5000(5,"1000-5000人"),
//	Less10000(6,"5000-10000人"),
//	Greater10000(7,"10000人以上")
	;
	
	public int getValue() {
		return value;
	}
	
	private int value;
	private String name;
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setValue(int value) {
		this.value = value;
	}

	private EnterpriseScaleType(int value,String name) {
		this.value = value;
		this.name=name;
	}
	
	public static EnterpriseScaleType valueOf(int val)
	{			
		for(EnterpriseScaleType m : EnterpriseScaleType.values()) 
		{
			if(val==m.getValue())
				return m;
	    }
		return null;
	}
	
	public static String scaleNameOf(int val)
	{
		EnterpriseScaleType scaleType=valueOf(val);
		if(scaleType==null)
		{
			return "未知";
		}
		return scaleType.getName();
	}
	
	public static List<KeyValue<Integer, String>> keyValues(){
		List<KeyValue<Integer, String>>  list=new ArrayList<>(6);
		for(EnterpriseScaleType m : EnterpriseScaleType.values()) 
		{
			KeyValue<Integer, String> keyValueItem=new KeyValue<>(m.getValue(),m.getName());
			list.add(keyValueItem);
	    }
		return list;
	}
}
